#ifndef CALLBACK_H_
#define CALLBACK_H_

namespace UniverseSound
{
	class SoundClip;

	class Callback
	{
	public:
		virtual ~Callback();
		virtual void execute(SoundClip *sound) = 0;
	};

	template <typename T>

	class CallbackPointer : public Callback
	{
	public:
		typedef void (T::*MemberFunction)(SoundClip *sound);
		CallbackPointer() : mUndefined(true)
		{
		}
		CallbackPointer(MemberFunction func, T* obj) : mFunction(func), mObject(obj), mUndefined(false)
		{
		}
		virtual ~CallbackPointer();
		void execute(SoundClip *sound);

	protected:
		MemberFunction mFunction;
		T* mObject;
		bool mUndefined;
	};
}

#endif